from tempfile import TemporaryFile, NamedTemporaryFile
f = TemporaryFile()
f.write("shisongyan")
f.seek(0)
print f.read(5)
print f.read(5)
print f.read(5)

ntf = NamedTemporaryFile()
print ntf.name